<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateMerchantUsersTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('merchant_users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('open_id', 64)->comment('openid');
            $table->string('status', 64)->default(0)->comment('状态');
            $table->string('nickname', 20)->default('')->comment('昵称');
            $table->string('mobile', 15)->default('')->comment('手机类型');
            $table->string('phone', 15)->default('')->comment('手机号');
            $table->string('avatarurl', 100)->default('')->comment('头像');
            $table->unsignedTinyInteger('gender')->nullable()->comment('性别0-男、1-女');
            $table->string('country', 10)->default('')->comment('国家');
            $table->string('province', 10)->default('')->comment('省份');
            $table->string('city', 10)->default('')->comment('城市');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('merchant_users');
    }
}
